<div class="layui-side layui-bg-black">
	<div class="layui-side-scroll">
		<#include "/apps/business/workorders/include/left.html">
	</div>
</div>
<div class="layui-body">
	<div class="layui-side-scroll">
		<div class="row">
			<div class="col-lg-12">
				<h1 class="site-h1" style="background-color:#FFFFFF;">
					工单分类列表<#if workOrderTypeList??>（${workOrderTypeList.totalElements}）</#if>
					<span style="float:right;">
						<button class="layui-btn layui-btn-sm green" href="/apps/workorder/type/add.html" data-toggle="ajax" data-width="650" data-height="350" data-title="创建分类">
							创建工单分类
						</button>
					</span>
				</h1>
				<div class="row" style="padding:5px;">
					<div class="col-lg-12">
						<table class="layui-table" lay-skin="line">
						  <colgroup>
								<col width="20%">
								<col width="20%">
								<col width="1%">
								<col>
						  </colgroup>
						  <thead>
							<tr>
							  <th>分类名称</th>
							  <th>创建时间</th>
							  <th style="white-space:nowrap;" nowrap="nowrap">操作</th>
							</tr> 
						  </thead>
						  <tbody>
							<#if workOrderTypeList?? && workOrderTypeList.content?? && workOrderTypeList.content?size gt 0>
							<#list workOrderTypeList.content as workOrderType>
							<tr>
							  <td>
								${workOrderType.name!''}
							  </td>
							  <td>${workOrderType.createtime?string("yyyy-MM-dd HH:mm:ss")}</td>
							  <td style="white-space:nowrap;" nowrap="nowrap">
							  		<a href="/apps/workorder/type/edit.html?id=${workOrderType.id!''}" data-toggle="ajax" data-width="650" data-height="350" data-title="编辑分类">
							  			<i class="layui-icon">&#xe642;</i>
							  			编辑
							  		</a>
							  		<a href="/apps/workorder/type/delete.html?id=${workOrderType.id!''}" style="margin-left:10px;" data-toggle="tip" title="请确认是否删除分类？" >
							  			<i class="layui-icon" style="color:red;">&#x1006;</i>
							  			删除
							  		</a>
							  </td>
							</tr>
							</#list>
							</#if>
						  </tbody>
						</table>
					</div> 	   
				</div>
				<div class="row" style="padding:5px;">
					<div class="col-lg-12" id="page" style="text-align:center;"></div>
				</div>
			</div>	
		</div>
		
	</div>
</div>
<script type="text/javascript">
layui.use(['laypage', 'layer'], function(){
	  var laypage = layui.laypage
	  ,layer = layui.layer;
	  <#if msg??>
	  top.layer.msg('${msg}');
	  </#if>
	  laypage.render({
			elem: 'page'
			,pages: <#if workOrderTypeList??>${workOrderTypeList.totalPages}<#else>0</#if> //总页数
			,curr:<#if workOrderTypeList??>${workOrderTypeList.number+1}<#else>0</#if>
			,groups: 5 //连续显示分页数
			,jump:function(data , first){
				if(!first){
					location.href = "/apps/workorder/type/index.html?p="+data.curr ;
				}
			}
	   });
	});
</script>